package com.wlc.mapper;

import com.wlc.pojo.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface RoleMapper {

    Long selectRoleCount(@Param("roleName") String roleName,
                         @Param("roleCode") String roleCode);

    List<Role> selectRoleList(@Param("roleName") String roleName,
                              @Param("roleCode") String roleCode,
                              @Param("offset") Integer offset,
                              @Param("limit") Integer limit);
    Role selectById(Long id);
    Role selectByRoleCode(String roleCode);
    List<Role> selectAll();
    int insert(Role role);
    int update(Role role);
    int deleteById(Long id);  // 改为物理删除

    // 角色菜单关联操作
    void insertRoleMenu(@Param("roleId") Long roleId, @Param("menuIds") List<Long> menuIds);
    void deleteRoleMenuByRoleId(Long roleId);
    List<Long> selectMenuIdsByRoleId(Long roleId);
}